home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / ENCRYPT.SWG / 0001_CHECKSUM.PAS.pas next >
Pascal/Delphi Source File  |  1993-05-28  |  2KB  |  51 lines

  1. (*
  2. > I finished Programming a Program in turbo pascal 7, and as some shareware
  3. > Programs like RemoteAccess, Fastecho and more i want my Program to use a
  4. > KEY File to know if the Program is registered or not (i will supply a key
  5. > For every sysop according to his bbs name and his name), any examples to
  6. > do such a Procedure?
  7.  
  8. You could do like I did in Terminate, make a big KeyFile around 4-8k and
  9. included all kind of checksums calculated on crc-sums and the name etc.
  10.  
  11. Calculate the Crc-sums in different ways, use always the GlobalChecksum to find
  12. out if there has been no errors in the File. If error in the global checksum:
  13.  
  14.   SetFAttr(keyFile,Archive)      { if the File has been set to readonly }
  15.   Erase(keyFile,archive)
  16.  
  17. Ask user to install a new copy of the keyFile.
  18.  
  19. Then somebody has changed it or an error has occured.
  20.  
  21. The next things is to use a different checksum For each release you make of
  22. your Program, then people will get annoyed over waiting For a new pirate key
  23. and hopefully will send you some money.
  24. The cracker cannot calculate the checksum if you have no code in the Program,
  25. but he can crack the current version, but if you release a new version often,
  26. people will get tired of that and pay. A checksum can be calculated in many
  27. different ways like below:
  28. *)
  29. Var
  30.  
  31.   KeyRec : Record
  32.     Crc  : Array[1..100] of LongInt;
  33.     Name : String[80];
  34.     GlobalChecksum;
  35.   end;
  36.  
  37. Var
  38.   Sum : LongInt;
  39.   X   : Word;
  40.  
  41. begin
  42.   Sum := 0;
  43.   For x := 1 to Sizeof(KeyRec) Do
  44.     Inc(Sum, Mem[Seg(KeyRec) : Seg(KeyRec) + x]);
  45.   { This will add all ascii values to crc, the cracker will prop. find
  46.     this out, but if you then : }
  47.   Dec(Sum,3248967);
  48.   { How should he find out if there is no code in your Program at the }
  49.   { present version }
  50. end.
  51.